package fag.core.game.test.arkanoid;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;

import fag.core.game.Camera;

public class ArkanoidHud extends Camera {

	private static final long serialVersionUID = 1820288153717138787L;
	private int score = 0;
	
	protected void drawHud(Graphics2D graphics2d) {
		
		Color oldColor = graphics2d.getColor();
		graphics2d.setColor(Color.BLACK);
		graphics2d.setFont(new Font("Arial", Font.BOLD, 20));
		String toDraw = String.format("Score %05d", score);
		graphics2d.drawString(toDraw, Arkanoid.HEIGHT / 3, 25);
		graphics2d.setColor(oldColor);
	}
	
	public void setScore(int score) {
		
		if(this.score != score) {
			this.score = score;
			repaint(0, 0, Arkanoid.WIDTH, 50);
		}
	}
}
